home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10943 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: gaia.ns.utk.edu!mbk
  2. From: mbk@caffeine.engr.utk.edu (RHS Linux User)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Followup-To: comp.lang.misc
  6. Date: 11 Mar 1996 21:35:43 GMT
  7. Organization: University of Tennessee, Knoxville and Oak Ridge National Laboratory
  8. Message-ID: <4i26bf$hki@gaia.ns.utk.edu>
  9. References: <4h5hgj$vpd@tomquartz.niestu.com> <4h7jskINNnph@anvil.ugrad.cs.ubc.ca> <313EDF38.61C1@lfwc.lockheed.com> <DnyCz1.A1n@research.att.com>
  10. Reply-To: kennel@msr.epm.ornl.gov
  11. NNTP-Posting-Host: caffeine.engr.utk.edu
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14. Andrew Koenig (ark@research.att.com) wrote:
  15. : In article <313EDF38.61C1@lfwc.lockheed.com> Ken Garlington <GarlingtonKE@lfwc.lockheed.com> writes:
  16.  
  17. : > Kazimir Kylheku wrote:
  18.  
  19. : > > This is false. There are compilers which offer range checking. In a situation
  20. : > > where safety-critical software is designed, such a compiler should be used.
  21.  
  22. : > I thought you were arguing the merits of two languages. Does the C _language_
  23. : > standard define the syntax and sematics of built-in range checking?
  24.  
  25. : Yes and no.  It defines what a range error is, then leaves it up to the
  26. : implementation to check for it or not.  Most, but not all, C implementations
  27. : don't bother to check, partly because checking is expensive at run time.
  28.  
  29. I suspect that this checking is more expensive or difficult to implement
  30. than similar checking for other languages becuase of the pointer/array
  31. ambiguity in C/C++.  (an argument typed as a T* might be to the beginning
  32. of heap storage, beginning of stack storage, or middle of any of them, or
  33. just to a single element not in an array, or to another element embedded
  34. inside a structure, or to an array embedded in another structure, or 
  35. somewhere else entirely.)
  36.  
  37. By contrast, nearly every Fortran or Ada or Eiffel compiler has an option
  38. to check array-out-of-bounds errors. 
  39.  
  40. Let's find the real reason why.....
  41.  
  42.  
  43.  
  44. : -- 
  45. :                 --Andrew Koenig
  46. :                   ark@research.att.com
  47.